#pragma once

#include <thrust/mismatch.h>

template <typename Container1,
          typename Container2>
struct Mismatch
{
  Container1 A;
  Container2 B;

  template <typename Range1, typename Range2>
  Mismatch(const Range1& X, const Range2& Y)
    : A(X.begin(), X.end()),
      B(Y.begin(), Y.end())
  {}

  void operator()(void)
  {
    thrust::mismatch(A.begin(), A.end(), B.begin());
  }
  
  void reset(void)
  {
    // nothing to do
  }
};

template <typename Container1,
          typename Container2,
          typename BinaryPredicate>
struct MismatchBinaryPred
{
  Container1 A;
  Container2 B;
  BinaryPredicate binary_pred;

  template <typename Range1, typename Range2>
  MismatchBinaryPred(const Range1& X, const Range2& Y, BinaryPredicate binary_pred)
    : A(X.begin(), X.end()),
      B(Y.begin(), Y.end()),
      binary_pred(binary_pred)
  {}

  void operator()(void)
  {
    thrust::mismatch(A.begin(), A.end(), B.begin(), binary_pred);
  }
  
  void reset(void)
  {
    // nothing to do
  }
};

